from drf_spectacular.utils import extend_schema
from rest_framework import viewsets

from .models import Config, Project
from .serializers import ConfigSerializer, ProjectSerializer


@extend_schema(tags=["Project"])
class ProjectViewSets(viewsets.ModelViewSet):
    queryset = Project.objects.all()  # 数据来源
    serializer_class = ProjectSerializer  # 数据格式


@extend_schema(tags=["Project"])
class ConfigViewSets(viewsets.ModelViewSet):
    queryset = Config.objects.all()  # 数据来源
    serializer_class = ConfigSerializer  # 数据格式
